// Decompiled on 周六 2月 22 19:31:49 CST 2025 with Zomboid Decompiler v0.1.3 using Vineflower.
package zombie.commands.serverCommands;

import zombie.commands.CommandBase;
import zombie.commands.CommandHelp;
import zombie.commands.CommandName;
import zombie.commands.RequiredRight;
import zombie.core.logger.LoggerManager;
import zombie.core.raknet.UdpConnection;
import zombie.debug.DebugLog;
import zombie.network.ServerMap;

@CommandName(
    name = "quit"
)
@CommandHelp(
    helpText = "UI_ServerOptionDesc_Quit"
)
@RequiredRight(
    requiredRights = 32
)
public class QuitCommand extends CommandBase {
    public QuitCommand(String username, String userAccessLevel, String command, UdpConnection connection) {
        super(username, userAccessLevel, command, connection);
    }

    @Override
    protected String Command() {
        DebugLog.Multiplayer.debugln(this.description);
        ServerMap.instance.QueueSaveAll();
        ServerMap.instance.QueueQuit();
        LoggerManager.getLogger("admin").write(this.getExecutorUsername() + " closed server");
        return "Quit";
    }
}
